#pragma once

#include "ipv4_address.h"
#include "limbo/details/traits.hpp"
#include "proto.h"

namespace limbo::ip {

template <typename State> struct IpContext {
  using ContextState = State;
  using LowerContext = details::lower_context_t<State>;

  IPv4Address source;
  IPv4Address destination;
  uint8_t ttl;
  Proto proto;
  uint8_t flags : 3;
  LowerContext *link_context;
};

template <typename State>
inline auto *get_lower_context(const IpContext<State> &ctx) {
  return ctx.link_context;
}

} // namespace limbo::ip
